package com.whz.enumordinal;

/**
 * @Author: sinosoft
 * @Description: 不要根据枚举的序数导出与它关联的值 而是要将它保存在一个实例域中
 * @Date: Create in 20:40 2021/5/14
 * @Modified By:
 */
public enum Ensemble1 {
    SOLO(1), DUET(2), TRIO(3), QUARTET(4), QUINTET(5);
    private final int numberOfMusicians;

    Ensemble1(int size) {
        this.numberOfMusicians = size;
    }
    public int numberOfMusicians() {
        return numberOfMusicians;
    }
}
